import React from 'react';

import {
    Form,  Input, 
  } from 'antd';
    


  class UserForm extends React.Component {

   
    handleSubmit = (e) => {
      // e.preventDefault();
      this.props.form.validateFields((err, values) => {
        if (!err) {
          console.log('Received values of form: ', values);
        }
      });
    }

  
    render() {
      const { getFieldDecorator } = this.props.form;
      return (
            <Form  onSubmit={this.handleSubmit}>  


            
             <Form.Item style={{display:"none"}} labelCol={{ span: 5 }} wrapperCol={{ span: 16 } }
               label="id"
              >
              
              {getFieldDecorator('id', {
                 rules: [
                  { required: false },
                ],
                })(
                  <Input />
                )}          
              </Form.Item>

          
              <Form.Item labelCol={{ span: 5 }} wrapperCol={{ span: 16 }}
                label="用户名"
              >
              
              {getFieldDecorator('username', {
                  rules: [
                    { required: true, message: '请输入用户名!' },
                  ],
                })(
                  <Input />
                )}          
              </Form.Item>
              <Form.Item labelCol={{ span: 5 }} wrapperCol={{ span: 16}}
                label="密码"
              >
                {getFieldDecorator('password', {
                  rules: [
                    { required: true, message: '请输入密码!' },
                  ],
                })(
                  <Input />
                )}
              
              </Form.Item>
              {/* <Form.Item
                wrapperCol={{ span: 12, offset: 5 }}
              >
                <Button type="primary" htmlType="submit">
                  Submit
                </Button>
              </Form.Item> */}
          </Form>
      );
    }
  }
  

  export default Form.create()(UserForm);
  
  // Form.create()(UserForm);